home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 2000
/
MacHack 2000.toast
/
pc
/
The Hacks
/
Softshoe
/
Lisa's Mac Parts
/
Fonts
/
FontSize.cp
< prev
next >
Wrap
Text File
|
2000-06-23
|
996b
|
59 lines
// FontSize.cp
#ifndef FontSize_h
#include "FontSize.h"
#endif
#include <Fonts.h>
FontSize::FontSize( uint16 value )
: size( ( value == 0 ) ? Default().Value() : value )
{
}
FontSize FontSize::Default()
{
static int16 size = GetDefFontSize();
return FontSize( size );
}
void FontSize::operator+=( int16 d )
{
int32 result = int32( size ) + int32( d );
Assert( result > 0 );
Assert( result <= maxint16 );
size = result;
}
void FontSize::operator-=( int16 d )
{
int32 result = int32( size ) - int32( d );
Assert( result > 0 );
Assert( result <= maxint16 );
size = result;
}
const FontSize FontSize::operator+( int16 d ) const
{
int32 result = int32( size ) + int32( d );
Assert( result > 0 );
Assert( result <= maxint16 );
return FontSize( result );
}
const FontSize FontSize::operator-( int16 d ) const
{
int32 result = int32( size ) - int32( d );
Assert( result > 0 );
Assert( result <= maxint16 );
return FontSize( result );
}